<?php
require(dirname(__FILE__) .'/check.php');
$skin->CheckIframe();


/* **** 版权所有 ****

 程序开发：网钛科技
 网钛CMS官网：http://otcms.com
 网钛IDC官网：http://idccms.com
 ＱＱ：877873666
 微信：tudougeaini
 邮箱：877873666@qq.com

 **** 版权所有 **** */



//打开用户表，并检测用户是否登录
$MB->Open('','login');

$skin->WebTop();

echo('
<script language="javascript" type="text/javascript" src="js/inc/calc.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/inc/list.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/vpsApiData.js?v='. OT_VERSION .'"></script>
');


switch ($mudi){
	case 'add':
		$MB->IsSecMenuRight('alertBack',348,$dataType);
		AddOrRev();
		break;

	case 'rev':
		$MB->IsSecMenuRight('alertBack',349,$dataType);
		AddOrRev();
		break;

	case 'manage':
		$MB->IsSecMenuRight('alertBack',346,$dataType);
		manage();
		break;

	default:
		die('err');
}

$skin->WebBottom();

$MB->Close();
$DB->Close();





// 新增、修改
function AddOrRev(){
	global $DB,$MB,$skin,$mudi,$dataType,$dataTypeCN;

	$mudi2		= OT::GetStr('mudi2');
	$dataMode	= OT::GetStr('dataMode');
	$dataModeStr= OT::GetStr('dataModeStr');
	$backURL	= OT::GetStr('backURL');
	$dataID		= OT::GetInt('dataID');

	$vpsSysArr = Cache::PhpFile('vpsSys');

	if ($mudi=='rev' || $mudi2 == 'copy'){
		$revexe=$DB->query('select * from '. OT_dbPref .'vpsApiData where VAD_ID='. $dataID);
		if (! $row = $revexe->fetch()){
			JS::AlertBackEnd('无该记录！');
		}
		$VAD_typeID			= $row['VAD_typeID'];
		$VAD_typeName		= $row['VAD_typeName'];
		$VAD_theme			= $row['VAD_theme'];
		$VAD_useMenuStr		= $row['VAD_useMenuStr'];
		$VAD_useTimeStr		= $row['VAD_useTimeStr'];
		$VAD_comProID		= $row['VAD_comProID'];
		$VAD_comServID		= $row['VAD_comServID'];
		$VAD_pcountry		= $row['VAD_pcountry'];
		$VAD_ptype			= $row['VAD_ptype'];
		$VAD_pname			= $row['VAD_pname'];
		$VAD_pbaoxiao		= $row['VAD_pbaoxiao'];

		$VAD_rateDayApi		= floatval($row['VAD_rateDayApi']);
		$VAD_rateWeekApi	= floatval($row['VAD_rateWeekApi']);
		$VAD_rateMonthApi	= floatval($row['VAD_rateMonthApi']);
		$VAD_rate3MonthApi	= floatval($row['VAD_rate3MonthApi']);
		$VAD_rate6MonthApi	= floatval($row['VAD_rate6MonthApi']);
		$VAD_rateYearApi	= floatval($row['VAD_rateYearApi']);
		$VAD_rate2YearApi	= floatval($row['VAD_rate2YearApi']);
		$VAD_rate3YearApi	= floatval($row['VAD_rate3YearApi']);
		$VAD_rate4YearApi	= floatval($row['VAD_rate4YearApi']);
		$VAD_rate5YearApi	= floatval($row['VAD_rate5YearApi']);

		$VAD_priceDay		= floatval($row['VAD_priceDay']);
		$VAD_priceWeek		= floatval($row['VAD_priceWeek']);
		$VAD_priceMonth		= floatval($row['VAD_priceMonth']);
		$VAD_price3Month	= floatval($row['VAD_price3Month']);
		$VAD_price6Month	= floatval($row['VAD_price6Month']);
		$VAD_priceYear		= floatval($row['VAD_priceYear']);
		$VAD_price2Year		= floatval($row['VAD_price2Year']);
		$VAD_price3Year		= floatval($row['VAD_price3Year']);
		$VAD_price4Year		= floatval($row['VAD_price4Year']);
		$VAD_price5Year		= floatval($row['VAD_price5Year']);
		$VAD_costDay		= floatval($row['VAD_costDay']);
		$VAD_costWeek		= floatval($row['VAD_costWeek']);
		$VAD_costMonth		= floatval($row['VAD_costMonth']);
		$VAD_cost3Month		= floatval($row['VAD_cost3Month']);
		$VAD_cost6Month		= floatval($row['VAD_cost6Month']);
		$VAD_costYear		= floatval($row['VAD_costYear']);
		$VAD_cost2Year		= floatval($row['VAD_cost2Year']);
		$VAD_cost3Year		= floatval($row['VAD_cost3Year']);
		$VAD_cost4Year		= floatval($row['VAD_cost4Year']);
		$VAD_cost5Year		= floatval($row['VAD_cost5Year']);
		$VAD_rateDay		= floatval($row['VAD_rateDay']);
		$VAD_rateWeek		= floatval($row['VAD_rateWeek']);
		$VAD_rateMonth		= floatval($row['VAD_rateMonth']);
		$VAD_rate3Month		= floatval($row['VAD_rate3Month']);
		$VAD_rate6Month		= floatval($row['VAD_rate6Month']);
		$VAD_rateYear		= floatval($row['VAD_rateYear']);
		$VAD_rate2Year		= floatval($row['VAD_rate2Year']);
		$VAD_rate3Year		= floatval($row['VAD_rate3Year']);
		$VAD_rate4Year		= floatval($row['VAD_rate4Year']);
		$VAD_rate5Year		= floatval($row['VAD_rate5Year']);
		$VAD_minPrice		= floatval($row['VAD_minPrice']);

		$VAD_content		= $row['VAD_content'];
		$VAD_adminNote		= $row['VAD_adminNote'];
		$VAD_userState		= $row['VAD_userState'];
		$VAD_state			= $row['VAD_state'];

		if ($mudi2 == 'copy'){
			$VAD_rank		= OT::ToInt($DB->GetOne('select max(VAD_rank) from '. OT_dbPref .'vpsApiData')) + 10;
			$mudiCN='添加';
		}else{
			$VAD_rank		= $row['VAD_rank'];
			$mudiCN='修改';
		}
		unset($revexe);
	}else{
		$VAD_typeID			= 0;
		$VAD_typeName		= '';
		$VAD_theme			= '';
		$VAD_useMenuStr		= '';
		$VAD_useTimeStr		= '|month||3month||6month||year||2year||3year||4year||5year|';
		$VAD_comProID		= '';
		$VAD_comServID		= 0;
		$VAD_pcountry		= '';
		$VAD_ptype			= '';
		$VAD_pname			= '';
		$VAD_pbaoxiao		= '';

		$VAD_rateDayApi		= '';
		$VAD_rateWeekApi	= '';
		$VAD_rateMonthApi	= '';
		$VAD_rate3MonthApi	= '';
		$VAD_rate6MonthApi	= '';
		$VAD_rateYearApi	= '';
		$VAD_rate2YearApi	= '';
		$VAD_rate3YearApi	= '';
		$VAD_rate4YearApi	= '';
		$VAD_rate5YearApi	= '';

		$VAD_priceDay		= '';
		$VAD_priceWeek		= '';
		$VAD_priceMonth		= '';
		$VAD_price3Month	= '';
		$VAD_price6Month	= '';
		$VAD_priceYear		= '';
		$VAD_price2Year		= '';
		$VAD_price3Year		= '';
		$VAD_price4Year		= '';
		$VAD_price5Year		= '';
		$VAD_costDay		= '';
		$VAD_costWeek		= '';
		$VAD_costMonth		= '';
		$VAD_cost3Month		= '';
		$VAD_cost6Month		= '';
		$VAD_costYear		= '';
		$VAD_cost2Year		= '';
		$VAD_cost3Year		= '';
		$VAD_cost4Year		= '';
		$VAD_cost5Year		= '';
		$VAD_rateDay		= floatval($vpsSysArr['VS_rateDayPro']);
		$VAD_rateWeek		= floatval($vpsSysArr['VS_rateWeekPro']);
		$VAD_rateMonth		= floatval($vpsSysArr['VS_rateMonthPro']);
		$VAD_rate3Month		= floatval($vpsSysArr['VS_rate3MonthPro']);
		$VAD_rate6Month		= floatval($vpsSysArr['VS_rate6MonthPro']);
		$VAD_rateYear		= floatval($vpsSysArr['VS_rateYearPro']);
		$VAD_rate2Year		= floatval($vpsSysArr['VS_rate2YearPro']);
		$VAD_rate3Year		= floatval($vpsSysArr['VS_rate3YearPro']);
		$VAD_rate4Year		= floatval($vpsSysArr['VS_rate4YearPro']);
		$VAD_rate5Year		= floatval($vpsSysArr['VS_rate5YearPro']);
		$VAD_minPrice		= '';

		$VAD_content		= '';
		$VAD_adminNote		= '';
		$VAD_rank			= intval($DB->GetOne('select max(VAD_rank) from '. OT_dbPref .'vpsApiData'))+10;
		$VAD_userState		= 1;
		$VAD_state			= 1;

		$mudiCN='添加';
	}
	$jinganProType = $VAD_ptype .'|'. $VAD_pname;

	echo('
	<form id="dealForm" name="dealForm" method="post" action="vpsApiData_deal.php?mudi='. $mudi .'&nohrefStr=close" onsubmit="return CheckForm()">
	<input type="hidden" id="dataID" name="dataID" value="'. $dataID .'" />
	<input type="hidden" id="dataTypeCN" name="dataTypeCN" value="'. $dataTypeCN .'" />
	<input type="hidden" id="dataType" name="dataType" value="'. $dataType .'" />
	<input type="hidden" id="dataMode" name="dataMode" value="'. $dataMode .'" />
	<input type="hidden" id="dataModeStr" name="dataModeStr" value="'. $dataModeStr .'" />
	<input type="hidden" id="rateDayApiOld" name="rateDayApiOld" value="" />
	<input type="hidden" id="rateWeekApiOld" name="rateWeekApiOld" value="" />
	<input type="hidden" id="rateMonthApiOld" name="rateMonthApiOld" value="" />
	<input type="hidden" id="rate3MonthApiOld" name="rate3MonthApiOld" value="" />
	<input type="hidden" id="rate6MonthApiOld" name="rate6MonthApiOld" value="" />
	<input type="hidden" id="rateYearApiOld" name="rateYearApiOld" value="" />
	<input type="hidden" id="rate2YearApiOld" name="rate2YearApiOld" value="" />
	<input type="hidden" id="rate3YearApiOld" name="rate3YearApiOld" value="" />
	<input type="hidden" id="rate4YearApiOld" name="rate4YearApiOld" value="" />
	<input type="hidden" id="rate5YearApiOld" name="rate5YearApiOld" value="" />
	'. Area::BackUrlInput($backURL) .'
	');

	$skin->TableTop('share_'. $mudi .'.gif','',$mudiCN . $dataTypeCN);
		echo('
		<table width="98%" align="center" cellpadding="0" cellspacing="0" summary="" class="padd3td">
		<tr>
			<td width="160"></td>
			<td></td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'产品类别：</td>
			<td align="left">
				<input type="hidden" id="apiID" name="apiID" value="" />
				<select id="typeID" name="typeID" onchange="SetThemeValue();LoadApiRate();CheckApiID();">
				');

					$typeexe = $DB->query('select VT_ID,VT_theme,VC_theme,VC_apiID from '. OT_dbPref .'vpsType as VT left join '. OT_dbPref .'vpsCompany as VC on VT.VT_companyID=VC.VC_ID where VT_classID=2 and VT_state=1 order by VT_rank ASC');	//  and VC_isApi=1
					if ($row = $typeexe->fetch()){
						echo('<option value=""></option>');
						do{
							echo('<option value="'. $row['VT_ID'] .'" '. Is::Selected($row['VT_ID'],$VAD_typeID) .'>'. $row['VT_theme'] .'  （公司：'. $row['VC_theme'] .'[api:'. $row['VC_apiID'] .']）</option>');
						}while ($row = $typeexe->fetch());
					}else{
						echo('<option value="">请先到【云服务器→云服务器设置】-【产品类型管理】添加记录下</option>');
					}
					unset($typeexe);

				echo('
				</select>
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'产品名称：</td>
			<td align="left">
				<input type="text" id="theme" name="theme" size="50" style="width:250px;" value="'. $VAD_theme .'" />&ensp;&ensp;
				<input type="button" value="获取产品类型名称" onclick="LoadVpsTypeText();" />
				<input type="button" value="获取类型(景安)名称" onclick="LoadJinganTypeText();" />
			</td>
		</tr>
		<tbody id="api6Box">
		<tr>
			<td align="right">'. Skin::RedSign() .'上级渠道商产品id：</td>
			<td align="left">
				<input type="text" id="comProID" name="comProID" size="50" style="width:80px;" value="'. $VAD_comProID .'" />&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'上级渠道商服务器id：</td>
			<td align="left">
				<input type="text" id="comServID" name="comServID" size="50" style="width:80px;" value="'. $VAD_comServID .'" />&ensp;&ensp;
			</td>
		</tr>
		</tbody>
		<tbody id="api1Box">
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">'. Skin::RedSign() .'接口费率：</td>
			<td align="left">
				<table cellspacing="0" cellpadding="0" style="width:620px;">
				<tr>
					<td align="right" valign="top">
						日付费率：<input type="text" id="rateDayApi" name="rateDayApi" size="50" style="width:60px;" value="'. $VAD_rateDayApi .'" />
						<div id="rateDayApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top">
						周付费率：<input type="text" id="rateWeekApi" name="rateWeekApi" size="50" style="width:60px;" value="'. $VAD_rateWeekApi .'" />
						<div id="rateWeekApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top" colspan="2">
						<input type="button" value="下面价格费率采用" onclick="LoadPriceRate()" style="margin-left:10px;color:#000;" />
						<input type="button" value="恢复默认费率" onclick="LoadDefRate()" style="margin-left:10px;color:blue;" />
					</td>
				</tr>
				<tr>
					<td align="right" valign="top" width="25%">
						月付费率：<input type="text" id="rateMonthApi" name="rateMonthApi" size="50" style="width:60px;" value="'. $VAD_rateMonthApi .'" />
						<div id="rateMonthApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top" width="25%">
						季付费率：<input type="text" id="rate3MonthApi" name="rate3MonthApi" size="50" style="width:60px;" value="'. $VAD_rate3MonthApi .'" />
						<div id="rate3MonthApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top" width="25%">
						半年付费率：<input type="text" id="rate6MonthApi" name="rate6MonthApi" size="50" style="width:60px;" value="'. $VAD_rate6MonthApi .'" />
						<div id="rate6MonthApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top" width="25%">
						年付费率：<input type="text" id="rateYearApi" name="rateYearApi" size="50" style="width:60px;" value="'. $VAD_rateYearApi .'" />
						<div id="rateYearApiStr" style="color:red;"></div>
					</td>
				</tr>
				<tr>
					<td align="right" valign="top">
						二年付费率：<input type="text" id="rate2YearApi" name="rate2YearApi" size="50" style="width:60px;" value="'. $VAD_rate2YearApi .'" />
						<div id="rate2YearApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top">
						三年付费率：<input type="text" id="rate3YearApi" name="rate3YearApi" size="50" style="width:60px;" value="'. $VAD_rate3YearApi .'" />
						<div id="rate3YearApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top">
						四年付费率：<input type="text" id="rate4YearApi" name="rate4YearApi" size="50" style="width:60px;" value="'. $VAD_rate4YearApi .'" />
						<div id="rate4YearApiStr" style="color:red;"></div>
					</td>
					<td align="right" valign="top">
						五年付费率：<input type="text" id="rate5YearApi" name="rate5YearApi" size="50" style="width:60px;" value="'. $VAD_rate5YearApi .'" />
						<div id="rate5YearApiStr" style="color:red;"></div>
					</td>
				</tr>
				</table>
				<div class="font2_2">说明：费率得与上级类系统的费率一致，否则会开通不了。</div>
			</td>
		</tr>
		</tbody>

		<tbody id="api2Box">
		<tr>
			<td align="right">'. Skin::RedSign() .'接口(景安)：</td>
			<td align="left">
				<select id="pcountry" name="pcountry">
					<option value="cn" '. Is::Selected($VAD_pcountry,'cn') .'>国内</option>
					<option value="hk" '. Is::Selected($VAD_pcountry,'hk') .'>香港国际</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'类型(景安)：</td>
			<td align="left">
				<select id="jinganProType" name="jinganProType" onchange="SetThemeValue();">
					<option value=""></option>
					<optgroup label="快云VPS" style="font-weight:normal;">
						<option value="fastcloudvps|fast.cloudvps.jichu" '. Is::Selected($jinganProType,'fastcloudvps|fast.cloudvps.jichu') .'>快云VPS基础型（1核，1G，1Mbps，40G+30G）</option>
						<option value="fastcloudvps|fast.cloudvps.puji" '. Is::Selected($jinganProType,'fastcloudvps|fast.cloudvps.puji') .'>快云VPS普及型（2核，2G，4Mbps，40G+60G）</option>
						<option value="fastcloudvps|fast.cloudvps.jingji" '. Is::Selected($jinganProType,'fastcloudvps|fast.cloudvps.jingji') .'>快云VPS经济型（4核，4G，5Mbps，40G+100G）</option>
						<option value="fastcloudvps|fast.cloudvps.haohua" '. Is::Selected($jinganProType,'fastcloudvps|fast.cloudvps.haohua') .'>快云VPS豪华型（4核，6G，6Mbps，40G+160G）</option>
						<option value="fastcloudvps|fast.cloudvps.qijian" '. Is::Selected($jinganProType,'fastcloudvps|fast.cloudvps.qijian') .'>快云VPS旗舰型</option>
						<option value="fastcloudvps|fast.cloudvps.zhizun" '. Is::Selected($jinganProType,'fastcloudvps|fast.cloudvps.zhizun') .'>快云VPS至尊型</option>
					</optgroup>
					<!-- <optgroup label="特卖VPS" style="font-weight:normal;">
						<option value="vps|temai.vps.jichu" '. Is::Selected($jinganProType,'vps|temai.vps.jichu') .'>特卖VPS基础型</option>
						<option value="vps|temai.vps.puji" '. Is::Selected($jinganProType,'vps|temai.vps.puji') .'>特卖VPS普及型</option>
						<option value="vps|temai.vps.jingji" '. Is::Selected($jinganProType,'vps|temai.vps.jingji') .'>特卖VPS经济型</option>
						<option value="vps|temai.vps.haohua" '. Is::Selected($jinganProType,'vps|temai.vps.haohua') .'>特卖VPS豪华型</option>
					</optgroup>
					<optgroup label="香港VPS" style="font-weight:normal;">
						<option value="vps|hk.vps.pj" '. Is::Selected($jinganProType,'vps|hk.vps.pj') .'>香港VPS普及型</option>
						<option value="vps|hk.vps.jingji" '. Is::Selected($jinganProType,'vps|hk.vps.jingji') .'>香港VPS经济型</option>
						<option value="vps|hk.vps.haohua" '. Is::Selected($jinganProType,'vps|hk.vps.haohua') .'>香港VPS豪华型</option>
						<option value="vps|hk.vps.zhizun" '. Is::Selected($jinganProType,'vps|hk.vps.zhizun') .'>香港VPS至尊型</option>
					</optgroup> -->
				</select>
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'包销(景安)：</td>
			<td align="left">
				<label><input type="checkbox" name="pbaoxiao[]" value="|month|" '. Is::InstrChecked($VAD_pbaoxiao,'|month|') .' />月包销</label>&ensp;&ensp;
				<label><input type="checkbox" name="pbaoxiao[]" value="|year|" '. Is::InstrChecked($VAD_pbaoxiao,'|year|') .' />年包销</label>&ensp;&ensp;
			</td>
		</tr>
		</tbody>

		<tr>
			<td align="right" valign="top" style="padding-top:6px;">功能区：</td>
			<td align="left">
				<label><input type="checkbox" name="useMenuStr[]" value="|noKaitong|" '. Is::InstrChecked($VAD_useMenuStr,'|noKaitong|') .' />关闭前台开通</label>&ensp;&ensp;
				<label><input type="checkbox" name="useMenuStr[]" value="|noXufei|" '. Is::InstrChecked($VAD_useMenuStr,'|noXufei|') .' />关闭前台续费</label>&ensp;&ensp;
				<label><input type="checkbox" name="useMenuStr[]" value="|guajibao|" '. Is::InstrChecked($VAD_useMenuStr,'|guajibao|') .' />挂机宝产品数量检测</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">'. Skin::RedSign() .'付款方式：</td>
			<td align="left">
				<label><input type="checkbox" id="uts_24hour" name="useTimeStr[]" value="|24hour|" '. Is::InstrChecked($VAD_useTimeStr,'|24hour|') .' />试用24小时（景安试用1天，转正为月付）</label>&ensp;&ensp;
				<label><input type="checkbox" id="uts_48hour" name="useTimeStr[]" value="|48hour|" '. Is::InstrChecked($VAD_useTimeStr,'|48hour|') .' />试用48小时（景安试用1天，转正为年付）</label>&ensp;&ensp;
				<br />
				<label><input type="checkbox" id="uts_day" name="useTimeStr[]" value="|day|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|day|') .' />日付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_week" name="useTimeStr[]" value="|week|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|week|') .' />周付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_month" name="useTimeStr[]" value="|month|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|month|') .' />月付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_3month" name="useTimeStr[]" value="|3month|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|3month|') .' />季付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_6month" name="useTimeStr[]" value="|6month|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|6month|') .' />半年付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<br />
				<label><input type="checkbox" id="uts_year" name="useTimeStr[]" value="|year|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|year|') .' />一年付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_2year" name="useTimeStr[]" value="|2year|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|2year|') .' />二年付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_3year" name="useTimeStr[]" value="|3year|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|3year|') .' />三年付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<!-- <label><input type="checkbox" id="uts_4year" name="useTimeStr[]" value="|4year|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|4year|') .' />四年付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				<label><input type="checkbox" id="uts_5year" name="useTimeStr[]" value="|5year|" onclick="CheckUseTimeStr()" '. Is::InstrChecked($VAD_useTimeStr,'|5year|') .' />五年付</label>&ensp;&ensp;&ensp;&ensp;&ensp;&ensp; -->
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'月付价格：</td>
			<td align="left">
				<input type="text" id="priceMonth" name="priceMonth" size="10" style="width:60px;" value="'. $VAD_priceMonth .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="costMonth" name="costMonth" size="10" style="width:60px;" value="'. $VAD_costMonth .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rateMonth" name="rateMonth" size="10" style="width:60px;" value="'. $VAD_rateMonth .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;<input type="button" value="自动计算" onclick="CalcPriceCost()" />
				&ensp;&ensp;&ensp;&ensp;
				最低代理价：<input type="text" id="minPrice" name="minPrice" size="10" style="width:60px;" value="'. $VAD_minPrice .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
			</td>
		</tr>
		<tr id="box_day">
			<td align="right">'. Skin::RedSign() .'日付价格：</td>
			<td align="left">
				<input type="text" id="priceDay" name="priceDay" size="10" style="width:60px;" value="'. $VAD_priceDay .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="costDay" name="costDay" size="10" style="width:60px;" value="'. $VAD_costDay .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rateDay" name="rateDay" size="10" style="width:60px;" value="'. $VAD_rateDay .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("day");\' />
			</td>
		</tr>
		<tr id="box_week">
			<td align="right">'. Skin::RedSign() .'周付价格：</td>
			<td align="left">
				<input type="text" id="priceWeek" name="priceWeek" size="10" style="width:60px;" value="'. $VAD_priceWeek .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="costWeek" name="costWeek" size="10" style="width:60px;" value="'. $VAD_costWeek .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rateWeek" name="rateWeek" size="10" style="width:60px;" value="'. $VAD_rateWeek .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("week");\' />
			</td>
		</tr>
		<tr id="box_3month">
			<td align="right">'. Skin::RedSign() .'季付价格：</td>
			<td align="left">
				<input type="text" id="price3Month" name="price3Month" size="10" style="width:60px;" value="'. $VAD_price3Month .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="cost3Month" name="cost3Month" size="10" style="width:60px;" value="'. $VAD_cost3Month .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rate3Month" name="rate3Month" size="10" style="width:60px;" value="'. $VAD_rate3Month .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("3month");\' />
			</td>
		</tr>
		<tr id="box_6month">
			<td align="right">'. Skin::RedSign() .'半年付价格：</td>
			<td align="left">
				<input type="text" id="price6Month" name="price6Month" size="10" style="width:60px;" value="'. $VAD_price6Month .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="cost6Month" name="cost6Month" size="10" style="width:60px;" value="'. $VAD_cost6Month .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rate6Month" name="rate6Month" size="10" style="width:60px;" value="'. $VAD_rate6Month .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("6month");\' />
			</td>
		</tr>
		<tr id="box_year">
			<td align="right">'. Skin::RedSign() .'一年付价格：</td>
			<td align="left">
				<input type="text" id="priceYear" name="priceYear" size="10" style="width:60px;" value="'. $VAD_priceYear .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="costYear" name="costYear" size="10" style="width:60px;" value="'. $VAD_costYear .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rateYear" name="rateYear" size="10" style="width:60px;" value="'. $VAD_rateYear .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("year");\' />
			</td>
		</tr>
		<tr id="box_2year">
			<td align="right">'. Skin::RedSign() .'两年付价格：</td>
			<td align="left">
				<input type="text" id="price2Year" name="price2Year" size="10" style="width:60px;" value="'. $VAD_price2Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="cost2Year" name="cost2Year" size="10" style="width:60px;" value="'. $VAD_cost2Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rate2Year" name="rate2Year" size="10" style="width:60px;" value="'. $VAD_rate2Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("2year");\' />
			</td>
		</tr>
		<tr id="box_3year">
			<td align="right">'. Skin::RedSign() .'三年付价格：</td>
			<td align="left">
				<input type="text" id="price3Year" name="price3Year" size="10" style="width:60px;" value="'. $VAD_price3Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="cost3Year" name="cost3Year" size="10" style="width:60px;" value="'. $VAD_cost3Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rate3Year" name="rate3Year" size="10" style="width:60px;" value="'. $VAD_rate3Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("3year");\' />
			</td>
		</tr>
		<tr id="box_4year" style="display:none;">
			<td align="right">'. Skin::RedSign() .'四年付价格：</td>
			<td align="left">
				<input type="text" id="price4Year" name="price4Year" size="10" style="width:60px;" value="'. $VAD_price4Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="cost4Year" name="cost4Year" size="10" style="width:60px;" value="'. $VAD_cost4Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rate4Year" name="rate4Year" size="10" style="width:60px;" value="'. $VAD_rate4Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("4year");\' />
			</td>
		</tr>
		<tr id="box_5year" style="display:none;">
			<td align="right">'. Skin::RedSign() .'五年付价格：</td>
			<td align="left">
				<input type="text" id="price5Year" name="price5Year" size="10" style="width:60px;" value="'. $VAD_price5Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				成本：<input type="text" id="cost5Year" name="cost5Year" size="10" style="width:60px;" value="'. $VAD_cost5Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				&ensp;&ensp;&ensp;&ensp;&ensp;&ensp;
				费率：<input type="text" id="rate5Year" name="rate5Year" size="10" style="width:60px;" value="'. $VAD_rate5Year .'" onkeyup="if (this.value!=FiltDecimal(this.value)){this.value=FiltDecimal(this.value)}" />
				<input type="button" value="计算" onclick=\'CalcRate("5year");\' />
			</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">配置说明：</td>
			<td align="left">
				<textarea id="content" name="content" style="width:400px;height:60px;">'. $VAD_content .'</textarea>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">内部备注：</td>
			<td align="left">
				<textarea id="adminNote" name="adminNote" style="width:400px;height:60px;">'. $VAD_adminNote .'</textarea>
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'排序：</td>
			<td align="left"><input type="text" id="rank" name="rank" size="50" style="width:60px;" value="'. $VAD_rank .'" /></td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'前台状态：</td>
			<td align="left">
				<label><input type="radio" name="userState" value="1" '. Is::Checked($VAD_userState,1) .' />显示</label>&ensp;&ensp;&ensp;&ensp;
				<label><input type="radio" name="userState" value="0" '. Is::Checked($VAD_userState,0) .' />隐藏</label>&ensp;&ensp;&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'后台状态：</td>
			<td align="left">
				<label><input type="radio" name="state" value="1" '. Is::Checked($VAD_state,1) .' />显示</label>&ensp;&ensp;&ensp;&ensp;
				<label><input type="radio" name="state" value="0" '. Is::Checked($VAD_state,0) .' />隐藏</label>&ensp;&ensp;&ensp;&ensp;
			</td>
		</tr>
		</table>
		');
	$skin->TableBottom();

	echo('
	<table style="height:16px;" cellpadding="0" cellspacing="0" summary=""><tr><td></td></tr></table>

	<center><input type="image" src="'. AdmTpl::ImgSrc('button_'. $mudi) .'" /></center>

	</form>
	');
}



function manage(){
	global $DB,$MB,$skin,$mudi,$dataType,$dataTypeCN,$pageCount,$recordCount;

	$dataMode		= OT::GetStr('dataMode');
	$dataModeStr	= OT::GetStr('dataModeStr');

	$reftypeID		= OT::GetInt('reftypeID');
	$refTheme		= OT::GetRegExpStr('refTheme','sql');
	$refNote		= OT::GetRegExpStr('refNote','sql');
	$refState		= OT::GetInt('refState',-1);
	$refUserState	= OT::GetInt('refUserState',-1);

	$SQLstr='select * from '. OT_dbPref .'vpsApiData where 1=1';

	if ($reftypeID > 0){ $SQLstr .= ' and VAD_typeID='. $reftypeID; }
	if ($refTheme != ''){ $SQLstr .= " and VAD_theme like '%". $refTheme ."%'"; }
	if ($refNote != ''){ $SQLstr .= " and VAD_note like '%". $refNote ."%'"; }
	if ($refState > -1){ $SQLstr .= ' and VAD_state='. $refState; }
	if ($refUserState > -1){ $SQLstr .= ' and VAD_userState='. $refUserState; }

	$orderName = OT::ListDefVal(OT::GetStr('orderName'), 'theme|typeName|typeID|comProID|priceMonth|costMonth|adminNote|rank|userState|state', 'rank');
	$orderSort = OT::ListDefVal(OT::GetStr('orderSort'), 'ASC', 'DESC');

	echo('
	<div style="padding:6px;">
		<input type="button" value="新增产品" onclick=\'document.location.href="?mudi=add&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&backURL="+ encodeURIComponent(document.location.href);\' />&ensp;
		<input type="button" value="产品类型管理" onclick=\'document.location.href="vpsType.php?mudi=manage&dataMode=vpsApi&dataType=&dataTypeCN='. urlencode('产品类型') .'&backURL="+ encodeURIComponent(document.location.href);\' />&ensp;
		&ensp;&ensp;&ensp;&ensp;
		<input type="button" value="母机列表设置" onclick=\'document.location.href="xingwaiServ.php?mudi=manage&dataType='. $dataType .'&dataTypeCN='. urlencode('母机') .'&backURL="+ encodeURIComponent(document.location.href);\' />&ensp;
		'. AppJingan::VpsApiDataItem() .'
		<!-- <input type="button" value="获取挂机宝剩余台数" onclick=\'DataDeal.location.href="readIdc.php?mudi=getGuajibaoNum&type=vpsApi";\' style="margin-left:10px;" /> -->
		&ensp;&ensp;&ensp;&ensp;

		产品类型：<select id="typeID" name="typeID" style="width:200px;" onchange="document.location.href=\'?mudi='. $mudi .'&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&reftypeID=\'+ this.value;">
			<option value="">显示全部</option>
			');
			$typeexe = $DB->query('select VT_ID,VT_theme,VC_theme,VC_apiID from '. OT_dbPref .'vpsType as VT left join '. OT_dbPref .'vpsCompany as VC on VT.VT_companyID=VC.VC_ID where VT_classID=2 and VT_state=1 order by VT_state DESC,VT_rank ASC');	//  and VC_isApi=1
				while ($row = $typeexe->fetch()){
					echo('<option value="'. $row['VT_ID'] .'" '. Is::Selected($row['VT_ID'],$reftypeID) .'>'. $row['VT_theme'] .'  （公司：'. $row['VC_theme'] .'）</option>');
				};
			unset($typeexe);

		echo('
		</select>
	</div>
	');

	$skin->TableTop('share_refer.gif','',$dataTypeCN .'查询');
		echo('
		<form id="refForm" name="refForm" method="get" action="">
		<input type="hidden" name="mudi" value="'. $mudi .'" />
		<input type="hidden" name="dataMode" value="'. $dataMode .'" />
		<input type="hidden" name="dataModeStr" value="'. $dataModeStr .'" />
		<input type="hidden" name="dataType" value="'. $dataType .'" />
		<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />

		<table style="width:90%;" align="center" border="0" cellSpacing="0" cellPadding="0" summary="" class="padd5td">
		<tr>
			<td>
				产品名称：<input type="text" name="refTheme" size="20" value="'. $refTheme .'" />
			</td>
			<td>
				内部备注：<input type="text" name="refNote" size="20" value="'. $refNote .'" />
			</td>
			<td>
				后台状态：<select id="refState" name="refState">
					<option value=""></option>
					<option value="1" '. Is::Selected($refState,1) .'>显示</option>
					<option value="0" '. Is::Selected($refState,0) .'>隐藏</option>
					</select>
				&ensp;&ensp;前台状态：<select id="refUserState" name="refUserState">
					<option value=""></option>
					<option value="1" '. Is::Selected($refUserState,1) .'>显示</option>
					<option value="0" '. Is::Selected($refUserState,0) .'>隐藏</option>
					</select>
			</td>
		</tr>
		<tr>
			<td align="center" style="padding:5px;padding-top:20px" colspan="3">
				<input type="image" src="'. AdmTpl::ImgSrc('button_refer') .'" />
				&ensp;&ensp;&ensp;&ensp;
				<img src="'. AdmTpl::ImgSrc('button_reset') .'" onclick=\'document.location.href="?mudi='. $mudi .'&dataMode='. $dataMode .'&dataModeStr='. $dataModeStr .'&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'"\' style="cursor:pointer;" alt="" />
			</td>
		</tr>
		</table>
		</form>
		');
	$skin->TableBottom();

	$typeArr = $companyArr = array();
	$typeexe = $DB->query('select VT_ID,VT_theme,VC_theme from '. OT_dbPref .'vpsType as VT left join '. OT_dbPref .'vpsCompany as VC on VT.VT_companyID=VC.VC_ID');
	while ($row = $typeexe->fetch()){
		$typeArr[$row['VT_ID']]		= $row['VT_theme'];
		$companyArr[$row['VT_ID']]	= $row['VC_theme'];
	}
	unset($typeexe);

	echo('
	<br />

	<form id="listForm" name="listForm" method="post" action="vpsApiData_deal.php?mudi=moreDel" onsubmit="return CheckListForm()">
	<script language="javascript" type="text/javascript">document.write (\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>
	<input type="hidden" name="dataType" value="'. $dataType .'" />
	<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
	');

	$skin->TableTop2('share_list.gif','',''. $dataTypeCN .'管理');
	$skin->TableItemTitle('3%,4%,14%,9%,5%,19%,6%,6%,10%,5%,9%,10%','<input type="checkbox" id="selAll" name="selAll" onclick="CheckBoxAll()" />,序号,'. $skin->ShowArrow('产品名称','theme',$orderName,$orderSort) .','. $skin->ShowArrow('上级渠道商','typeID',$orderName,$orderSort) .',占用,费率/属性,'. $skin->ShowArrow('月付价格','priceMonth',$orderName,$orderSort) .','. $skin->ShowArrow('月付成本','costMonth',$orderName,$orderSort) .','. $skin->ShowArrow('内部备注','adminNote',$orderName,$orderSort) .','. $skin->ShowArrow('排序','rank',$orderName,$orderSort) .','. $skin->ShowArrow('前台','userState',$orderName,$orderSort) .'/'. $skin->ShowArrow('后台','state',$orderName,$orderSort) .',复制&ensp;修改&ensp;&ensp;删除');

	$pageSize	= $MB->mMbRow['MB_itemNum'];		//每页条数
	$page		= OT::GetInt('page');
	$showRow=$DB->GetLimit($SQLstr .' order by VAD_'. $orderName .' '. $orderSort,$pageSize,$page);
	if (! $showRow){
		$skin->TableNoData();
	}else{
		$recordCount=$DB->GetRowCount();
		$pageCount=ceil($recordCount/$pageSize);
		if ($page < 1 || $page > $pageCount){$page=1;}

		echo('
		<tbody class="tabBody padd3td">
		');
		$number=1+($page-1)*$pageSize;
		$rowCount = count($showRow);
		for ($i=0; $i<$rowCount; $i++){
			if ($i % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
			// '. IdcInfo::UseTimeStrCN($showRow[$i]['VAD_useTimeStr']) .'
			$themeAddi = $addiStr = $addiStr2 = '';
			if ($showRow[$i]['VAD_apiID'] == 2){
				for ($n=1; $n<=2; $n++){
					if ($n == 2){
						$typeStr = 'Xu';
						$nameStr = '续';
					}else{
						$typeStr = '';
						$nameStr = '购';
					}
					$rs = $DB->GetRow('select VR_time,VR_value from '. OT_dbPref .'vpsRecord where VR_dataID='. $showRow[$i]['VAD_ID'] .' and VR_type="vpsApiBaoxiao'. $typeStr .'1" order by VR_time DESC limit 1');
					if ($rs){
						$rStr = '月'. $nameStr .'包销数量：'. $rs['VR_value'] .'，最后更新：'. $rs['VR_time'];
						if (strpos(''. $showRow[$i]['VAD_pbaoxiao'],'|month|') !== false){
							$addiStr .= '<span title="'. $rStr .'">[月'. $nameStr .'包'. $rs['VR_value'] .']</span> ';
						}
					}else{
						$rStr = '';
					}
					$rs = null;

					$rs = $DB->GetRow('select VR_time,VR_value from '. OT_dbPref .'vpsRecord where VR_dataID='. $showRow[$i]['VAD_ID'] .' and VR_type="vpsApiBaoxiao'. $typeStr .'12" order by VR_time DESC limit 1');
					if ($rs){
						$rStr = '年'. $nameStr .'包销数量：'. $rs['VR_value'] .'，最后更新：'. $rs['VR_time'];
						if (strpos(''. $showRow[$i]['VAD_pbaoxiao'],'|year|') !== false){
							$addiStr .= '<span title="'. $rStr .'">[年'. $nameStr .'包'. $rs['VR_value'] .']</span> ';
						}
					}else{
						$rStr = '';
					}
					$rs = null;

					$addiStr = '<div style="color:blue;">'. $addiStr .'</div>';
				}

				$addiStr2 .= '<div class="font3_2">'. ($showRow[$i]['VAD_pcountry']=='hk' ? '<span title="香港国际景安">国际景安</span>' : '') .'</div>';

			}else{
				$addiStr = '
					<table cellpadding="0" cellspacing="0" width="98%">
					<tr>
						<td style="padding:1px;">　日：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rateDayApi']) .'</span></td>
						<td style="padding:1px;">　周：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rateWeekApi']) .'</span></td>
					</tr>
					<tr>
						<td style="padding:1px;">　月：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rateMonthApi']) .'</span></td>
						<td style="padding:1px;">　季：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rate3MonthApi']) .'</span></td>
					</tr>
					<tr>
						<td style="padding:1px;">半年：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rate6MonthApi']) .'</span></td>
						<td style="padding:1px;">　年：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rateYearApi']) .'</span></td>
					</tr>
					<tr>
						<td style="padding:1px;">二年：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rate2YearApi']) .'</span></td>
						<td style="padding:1px;">三年：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rate3YearApi']) .'</span></td>
					</tr>
					<tr style="display:none;">
						<td style="padding:1px;">四年：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rate4YearApi']) .'</span></td>
						<td style="padding:1px;">五年：<span style="color:blue;">'. floatval($showRow[$i]['VAD_rate5YearApi']) .'</span></td>
					</tr>
					</table>
					';
				if (strpos(''. $showRow[$i]['VAD_useMenuStr'],'|guajibao|') !== false){
					$themeAddi = '<div style="margin-top:5px;" title="最后检测：'. $showRow[$i]['VAD_guajibaoTime'] .'"><a href="http://api.ipcomserver.com/user/vps-serverID.asp?id='. $showRow[$i]['VAD_comProID'] .'" target="_blank" style="color:blue;">['. TimeDate::DiffDayCN($showRow[$i]['VAD_guajibaoTime'],'','') .'前剩 <span style="color:red;">'. $showRow[$i]['VAD_guajibaoNum'] .'</span> 台]</a></div> ';
				}
			}

			if ( isset($typeArr[$showRow[$i]['VAD_typeID']]) ){
				$typeName = $typeArr[$showRow[$i]['VAD_typeID']];
			}else{
				$typeName = '<span style="text-decoration:line-through;colr:#666;">'. $showRow[$i]['VAD_typeName'] .'</span>';
			}

			$themeAddi .= '<span style="color:red;font-size:12px;">'. IdcInfo::UseMenuCN($showRow[$i]['VAD_useMenuStr']) .'</span>';
			$addiStr .= '<span style="color:red;font-size:12px;">'. IdcInfo::UseTimeCN($showRow[$i]['VAD_useTimeStr']) .'</span>';

			echo('
			<tr id="data'. $showRow[$i]['VAD_ID'] .'" '. $bgcolor .'>
				<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $showRow[$i]['VAD_ID'] .'" /></td>
				<td align="center" title="ID:'. $showRow[$i]['VAD_ID'] .'">'. $number .'</td>
				<td align="left">
					'. $showRow[$i]['VAD_theme'] .'
					<div style="margin-top:5px;color:#c9c9c9;">'. $typeName .'</div>
					<div>'. $themeAddi .'</div>
				</td>
				<td align="center">
					'. $companyArr[$showRow[$i]['VAD_typeID']] .'
					<div class="font1_2d" style="padding-top:5px;">API:'. $showRow[$i]['VAD_apiID'] .'&ensp;|&ensp;<span title="上级渠道商产品id">'. $showRow[$i]['VAD_comProID'] .'</span></div>
				</td>
				<td align="center" title="占用该产品的机器台数">'. $DB->GetOne('select count(VAU_ID) from '. OT_dbPref .'vpsApiUsers where VAU_proDataID='. $showRow[$i]['VAD_ID']) .'</td>
				<td align="left">'. $addiStr .'</td>
				<td align="right" style="padding-right:5px;">'. $showRow[$i]['VAD_priceMonth'] .'</td>
				<td align="right" style="padding-right:5px;">'. $showRow[$i]['VAD_costMonth'] .'</td>
				<td align="center">'. $showRow[$i]['VAD_adminNote'] .'</td>
				<td align="center">'. $showRow[$i]['VAD_rank'] .'</td>
				<td align="center">'.
					Adm::SwitchBtn('vpsApiData',$showRow[$i]['VAD_ID'],$showRow[$i]['VAD_userState'],'userState')
					.'/'.
					Adm::SwitchBtn('vpsApiData',$showRow[$i]['VAD_ID'],$showRow[$i]['VAD_state'],'state')
					.'
				</td>
				<td align="center">
					<img src="images/img_copy.gif" class="pointer" onclick=\'document.location.href="?mudi=add&mudi2=copy&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataID='. $showRow[$i]['VAD_ID'] .'&backURL="+ encodeURIComponent(document.location.href)\' alt="复制" title="复制" />&ensp;&ensp;
					<img src="images/img_rev.gif" class="pointer" onclick=\'document.location.href="vpsApiData.php?mudi=rev&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataID='. $showRow[$i]['VAD_ID'] .'&backURL="+ encodeURIComponent(document.location.href)\' alt="修改" />&ensp;&ensp;
					<img src="images/img_del.gif" class="pointer" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="vpsApiData_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($showRow[$i]['VAD_theme']) .'&dataID='. $showRow[$i]['VAD_ID'] .'"}\' alt="删除" />
				</td>
			</tr>
			');
			$number ++;
		}
		echo('
		</tbody>
		<tr class="tabColorB padd5">
			<td align="left" colspan="20">
				<input type="button" value="全选" onclick="AllSelBox()" class="form_button1" />
				<input type="button" value="反选" onclick="RevSelBox()" class="form_button1" />
				&ensp;
				<input type="submit" value="批量删除" />
				&ensp;&ensp;&ensp;&ensp;
				<select id="moreSetTo" name="moreSetTo" onchange="MoreSetTo()" style="width:150px;">
					<option value="">批量设置成...</option>
					<option value="userState1" style="color:#0066CC;">前台状态：显示</option>
					<option value="userState0" style="color:red;">前台状态：隐藏</option>
					<option value="state1" style="color:#0066CC;">后台状态：显示</option>
					<option value="state0" style="color:red;">后台状态：隐藏</option>
				</select>
				<input type="hidden" id="moreSetToCN" name="moreSetToCN" value="" />
			</td>
		</tr>
		');
	}
	unset($showRow);

	echo('</form>');

	$skin->TableBottom2($pageCount, $pageSize, $recordCount);

}

?>